<?php 
include("includes/code_admin.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title><?php echo SITEURL; ?> Administrator</title>
<link href="style_admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="script.js"></script>
<!-- TinyMCE -->
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "jbimages,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,|,jbimages",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",

		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Bu kod rasm yuklash plugini uchun (jbimages plugini)
        relative_urls : false,
		
		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "tinymce/examples/lists/template_list.js",
		external_link_list_url : "tinymce/examples/lists/link_list.js",
		external_image_list_url : "tinymce/examples/lists/image_list.js",
		media_external_list_url : "tinymce/examples/lists/media_list.js",

		// Style formats
		style_formats : [
			{title : 'Bold text', inline : 'b'},
			{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
			{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
			{title : 'Example 1', inline : 'span', classes : 'example1'},
			{title : 'Example 2', inline : 'span', classes : 'example2'},
			{title : 'Table styles'},
			{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
		],

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
</script>
<!-- /TinyMCE -->
</head>

<body>
<div id="container">
<table class="main" cellspacing="0" cellpadding="0">
  <tr>
    <td class="header">
    <!-- header start -->
    <?php include("includes/header.php");?>
    <!-- header finish -->
    </td>
  </tr>
  <tr>
    <td class="middle">&nbsp;</td>
  </tr>
  <tr>
    <td>
    <!-- tepa start -->
<?php include("includes/tepa.php"); ?>
    <!-- tepa finish -->
    </td>
  </tr>
  <tr>
    <td>
    <!-- contant start -->
<table class="content" cellspacing="0" cellpadding="0">
  <tr valign="top">
    <td>
    <!-- right col -->
<div class="right_col">
<h3 class="title">Reklama va Hakoarlar</h3>

<?php 
if(isset($_POST['send_reklama']))
{
	$hamkor = $_POST['hamkor'];
	$hamkor = addslashes($hamkor);
	
	$natija = mysql_query("UPDATE contact SET hamkor='$hamkor' WHERE id='1'");

	if($natija=='true') 
	{
	echo "<p class='ok'>Matn o'zgardi, OK...</p><br><center><a href='index.php'><b>Bosh sahifaga</b></a></center>";
	}
	else 
	{
	myerror("Afsuski matn o'zgarmadi, xatolik"); 
	}

}

if(!isset($_POST['send_reklama']))
{
	$result_adv = mysql_query("SELECT hamkor FROM contact", $db);
	if (!$result_adv)
	{ myerror("Contact jadvalidan hamkorlar haqida malumotlar olinmadi, xatolik"); }
	
	$row_adv = mysql_fetch_array($result_adv);
	$matn = stripslashes($row_adv["hamkor"]);
?>

<fieldset>
<legend style="color:#728D9E">Hamkorlar haqidagi matn</legend>

<form style="margin:10px;"  name="myform" action="" method="post">
<textarea cols="50" rows="10" name="hamkor"><? echo $matn; ?></textarea> <br><br>
<input type="submit" name="send_reklama" value=" Saqlash " />
</form>
</fieldset>
<?php 
}
?>

</div>
	<!-- right col finish -->
    </td>
  </tr>
</table>


    <!-- contant finish -->
    </td>
  </tr>
</table>
<!-- futer start -->
<?php include("includes/futer.php"); ?>
<!-- futer finish -->
</div>
</body>
</html>
